<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

    </style>
</head>

<body>
    <h1>0</h1>
    <script>
        let count = 0;
        setInterval(f, 1000)

        function f() {
            count++;
            let h = document.querySelector("h1");
            h.innerHTML = count;
        }

        let timer = setInterval(function () {
            console.log(count);
            if (count == 5) {
                clearInterval(timer);
            }
        }, 1000);

        setTimeout(function () {
            console.log("王冉婷")
        }, 2500)
    </script>


</body>

</html>